import Vue from "vue";
import Router from "vue-router";

import login from "../views/login";
import index from "../views/index";
import weibologin from "../views/weibologin";

/**
 * 基础菜单
 */

//用户

//登记说明
import registration from "../views/personal/handling_instructions/registration";
//常见问题
import problem from "../views/personal/handling_instructions/problem";
//办理点查询
import processing_point from "../views/personal/handling_instructions/processing_point";
//爱犬登记
import pet_register from "../views/personal/business_handling/pet_register";
//爱犬注销
import pet_cancel from "../views/personal/business_handling/pet_cancel";
//养犬审批进度
import approvals from "../views/personal/business_handling/approvals/raise_dog";
//犬只过户
import pet_transfer from "../views/personal/business_handling/pet_transfer";
//处罚记录
import penalty_record from "../views/personal/business_handling/penalty_record";
//年审记录
import annual_review from "../views/personal/business_handling/annual_review";
//文明学习
import study from "../views/personal/convenient_service/study";
//犬只(知识)库
import pet_knowledge from "../views/personal/convenient_service/pet_knowledge";
//犬只禁行区域
import pet_restricted_area from "../views/personal/convenient_service/pet_restricted_area";
//曝光台
import exposure from "../views/personal/convenient_service/exposure";
//犬只领养
import pet_adopt from "../views/personal/adopt/pet_adopt";
//个人信息
import per_information from "../views/personal/per_center/per_information";
//我的爱犬
import my_pet from "../views/personal/per_center/my_pet";
//电子犬证
import etc_pet_card from "../views/personal/per_center/etc_pet_card";
//投诉通道
import complaint from "../views/personal/per_center/complaint";
//消息通知
import message from "../views/personal/message";
//用户登记
import register_info from "../views/personal/business_handling/register_info";
//注销页面
import logout from "../views/personal/business_handling/logout";

/**
 * 检查机构
 */
//犬只管理
import administration from "../views/hospital/verification/administration";
//待检验犬只
import for_inspect_pet from "../views/hospital/verification/for_inspect_pet";
//犬只检验
import inspect_pet from "../views/hospital/verification/inspect_pet";
//免疫登记
import immunization_registration from "../views/hospital/verification/immunization_registration";
//免疫登记信息修改
import immunization_registration_amend from "../views/hospital/verification/immunization_registration_amend";
//犬只免疫详情
import progress_bar from "../views/hospital/verification/progress_bar";
//宠物知识发布
import publishing_knowledge from "../views/hospital/intellectual/publishing_knowledge";
//宠物知识查看
import see_knowledge from "../views/hospital/intellectual/see_knowledge";
//机构详情
import organization_condition from "../views/hospital/organization/organization_condition.vue";



/**
 * 警察机构
 */
//犬只查询
import pet_query from "../views/police/business_handling/pet_query";
//犬只登记审核
import registration_audit from "../views/police/business_handling/registration_audit";
//犬只登记审核详情审核页面
import registration_info from "../views/police/business_handling/registration_info";
//犬牌登记页面
import pet_brand_login from "../views/police/business_handling/pet_brand_login";
//犬只注销审批
import cancellation_audit from "../views/police/business_handling/cancellation_audit";
//犬只过户审批
import transfer_audit from "../views/police/business_handling/transfer_audit";
//曝光台审核
import exposure_audit from "../views/police/business_handling/exposure_audit";
//犬牌发放
import pet_brand_grant from "../views/police/business_handling/pet_brand_grant";
//犬证发放
import pet_syndrome_grant from "../views/police/business_handling/pet_syndrome_grant";
//犬牌补领
import pet_brand_replacement from "../views/police/business_handling/pet_brand_replacement";
//犬只收缴
import pet_confiscate from "../views/police/law_enforcement/pet_confiscate";
//犬只收养发布
import pet_adopt_release from "../views/police/law_enforcement/pet_adopt_release";
//犬只处罚
import pet_punishment from "../views/police/law_enforcement/pet_punishment";
//投诉消息
import complain_response from "../views/police/business_handling/complain_response";
//犬只禁行区域划分
import pet_restricted_area_division from "../views/police/law_enforcement/pet_restricted_area_division";

Vue.use(Router);

//解决重新路由重复报错的
const VueRouterPush = Router.prototype.push;
Router.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch(err => err);
};
export default new Router({
  routes: [
    {
      path: "/",
      name: "",
      component: login,
      hidden: true,
      meta: {
        requireAuth: true,
        roles: ["superadmin", "admin", "user"]
      }
    },
    {
      path: "/login",
      name: "登录",
      component: login,
      hidden: true,
      meta: {
        //requireAuth表示该路由需不需要检测,true表示需要,false表示不需要
        requireAuth: false
      }
    },
    {
      path: "/weibologin",
      name: "微博登录",
      component: weibologin,
      hidden: true,
      meta: {
        requireAuth: false
      }
    },

    {
      path: "/index",
      name: "主页",
      component: index,
      hidden: true,
      children: [
        {
          path: "/personal/handling_instructions/registration",
          name: "登记说明",
          component: registration,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/handling_instructions/problem",
          name: "常见问题",
          component: problem,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/handling_instructions/processing_point",
          name: "办理点查询",
          component: processing_point,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/business_handling/pet_register",
          name: "爱犬登记",
          component: pet_register,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/business_handling/register_info",
          name: "具体的养犬登记信息",
          component: register_info,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/business_handling/pet_cancel",
          name: "爱犬注销",
          component: pet_cancel,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/business_handling/approvals/raise_dog",
          name: "养犬审批进度",
          component: approvals,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/business_handling/pet_transfer",
          name: "犬只过户",
          component: pet_transfer,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/business_handling/penalty_record",
          name: "处罚记录",
          component: penalty_record,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/convenient_service/study",
          name: "文明学习",
          component: study,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/business_handling/annual_review",
          name: "年审记录",
          component: annual_review,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/convenient_service/pet_knowledge",
          name: "犬只知识库",
          component: pet_knowledge,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/convenient_service/pet_restricted_area",
          name: "犬只禁行区域",
          component: pet_restricted_area,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/convenient_service/exposure",
          name: "曝光台",
          component: exposure,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/adopt/pet_adopt",
          name: "犬只领养",
          component: pet_adopt,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/per_center/per_information",
          name: "个人信息",
          component: per_information,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/per_center/my_pet",
          name: "我的爱犬",
          component: my_pet,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/per_center/etc_pet_card",
          name: "电子犬证",
          component: etc_pet_card,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/per_center/complaint",
          name: "投诉通道",
          component: complaint,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/business_handling/logout",
          name: "具体的注销流程页面",
          component: logout,
          meta: { requireAuth: false }
        },
        {
          path: "/personal/message",
          name: "消息通知",
          component: message,

          meta: { requireAuth: false }
        },

        {
          path: "/hospital/verification/administration",
          name: "犬只管理",
          component: administration,
          meta: { requireAuth: false }
        },
        {
          path: "/hospital/verification/for_inspect_pet",
          name: "待检验犬只",
          component: for_inspect_pet,
          meta: { requireAuth: false }
        },
        {
          path: "/hospital/verification/inspect_pet",
          name: "犬只检验",
          component: inspect_pet,
          meta: { requireAuth: false }
        },
        {
          path: "/hospital/verification/immunization_registration",
          name: "免疫登记",
          component: immunization_registration,
          meta: { requireAuth: false }
        },
        {
          path: "/hospital/verification/immunization_registration_amend",
          name: "免疫登记信息修改",
          component: immunization_registration_amend,
          meta: { requireAuth: false }
        },
        {
          path: "/hospital/verification/progress_bar",
          name: "犬只免疫详情",
          component: progress_bar,
          meta: { requireAuth: false }
        },
        {
          path: "/hospital/intellectual/publishing_knowledge",
          name: "宠物知识发布",
          component: publishing_knowledge,
          meta: { requireAuth: false }
        },
        {
          path: "/hospital/intellectual/see_knowledge",
          name: "宠物知识查看",
          component: see_knowledge,
          meta: { requireAuth: false }
        },
        {
          path: "/hospital/organization/organization_condition",
          name: "机构详情",
          component: organization_condition,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/pet_query",
          name: "犬只查询",
          component: pet_query,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/registration_audit",
          name: "犬只登记审核",
          component: registration_audit,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/registration_info",
          name: "犬只登记审批详情页面",
          component: registration_info,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/cancellation_audit",
          name: "犬只注销审批",
          component: cancellation_audit,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/transfer_audit",
          name: "投诉消息",
          component: transfer_audit,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/pet_brand_login",
          name: "犬牌登记",
          component: pet_brand_login,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/exposure_audit",
          name: "曝光台审核",
          component: exposure_audit,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/pet_brand_grant",
          name: "犬牌发放",
          component: pet_brand_grant,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/pet_syndrome_grant",
          name: "犬证登记",
          component: pet_syndrome_grant,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/complain_response",
          name: "投诉内容",
          component: complain_response,
          meta: { requireAuth: false }
        },
        {
          path: "/police/business_handling/pet_brand_replacement",
          name: "犬牌补领",
          component: pet_brand_replacement,
          meta: { requireAuth: false }
        },
        {
          path: "/police/law_enforcement/pet_confiscate",
          name: "犬只收缴",
          component: pet_confiscate,
          meta: { requireAuth: false }
        },
        {
          path: "/police/law_enforcement/pet_adopt_release",
          name: "犬只收养发布",
          component: pet_adopt_release,
          meta: { requireAuth: false }
        },
        {
          path: "/police/law_enforcement/pet_punishment",
          name: "犬只处罚",
          component: pet_punishment,
          meta: { requireAuth: false }
        },
        {
          path: "/police/law_enforcement/pet_restricted_area_division",
          name: "犬只禁行区域划分",
          component: pet_restricted_area_division,
          meta: { requireAuth: false }
        },
      
      ]
    }
  ],
  mode: "history"
});
